home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 31
/
PC Gamer IT CD 31 1-2.iso
/
DINKDEMO
/
dink101.exe
/
DINK
/
STORY
/
ITEM-FB.C
< prev
next >
Wrap
Text File
|
1997-10-01
|
2KB
|
126 lines
//item fireball
void use( void )
{
//disallow diagonal fireballs for now
if (sp_dir(1, -1) == 1)
sp_dir(1, 2);
if (sp_dir(1, -1) == 3)
sp_dir(1, 2);
if (sp_dir(1, -1) == 7)
sp_dir(1, 8);
if (sp_dir(1, -1) == 9)
sp_dir(1, 8);
&basehit = sp_dir(1, -1);
&basehit += 320;
sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
&magic_level = 0;
draw_status();
&mholdx = sp_x(1, -1);
&mholdy = sp_y(1, -1);
wait(100);
if (sp_dir(1, -1) == 4)
{
&mholdx -= 30;
&junk = create_sprite(&mholdx, &mholdy, 11, 504, 1);
sp_seq(&junk, 504);
sp_dir(&junk, 4);
}
if (sp_dir(1, -1) == 6)
{
// &mholdy -= 10;
&mholdx += 30;
&junk = create_sprite(&mholdx, &mholdy, 11, 506, 1);
sp_seq(&junk, 506);
sp_dir(&junk, 6);
}
if (sp_dir(1, -1) == 2)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 502, 1);
sp_seq(&junk, 502);
sp_dir(&junk, 2);
}
if (sp_dir(1, -1) == 8)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 508, 1);
sp_seq(&junk, 508);
sp_dir(&junk, 8);
}
//create fake shadow effect
playsound(17, 8000,0,&junk,0);
sp_timing(&junk, 0);
sp_speed(&junk, 6);
sp_strength(&junk, 10);
sp_flying(&junk, 1);
sp_script(&junk, "dam-fire");
//when the fireball hits something, it will look to this script, this way
//we can burn trees when appropriate
&mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3);
sp_brain_parm(&mshadow, &junk);
sp_que(&mshadow, -500);
//will be drawn under everything
//set fireball to not be able to damage Dink or the shadow
sp_brain_parm(&junk, 1);
sp_brain_parm2(&junk, &mshadow);
}
void disarm(void)
{
&magic_cost = 0;
kill_this_task();
}
void arm(void)
{
Debug("Preloading fireball");
int &basehit;
int &mholdx;
int &mholdy;
int &junk;
int &mshadow;
&magic_cost = 100;
preload_seq(322);
preload_seq(324);
preload_seq(326);
preload_seq(328);
preload_seq(502);
preload_seq(504);
preload_seq(506);
preload_seq(508);
//tree burn
preload_seq(20);
//explosion
preload_seq(70);
}
void pickup(void)
{
Debug("Player now owns this item.");
kill_this_task();
}
void drop(void)
{
Debug("Item dropped.");
kill_this_task();
}